﻿using HK.Core.Common.Data;
using HK.Core.Common.Protocol.Data;
using HK.Editor.Common.Protocol;
using HK.Editor.GUIEx.Data;
using HK.Editor.GUIEx.Protocol.Data;
using HK.Editor.GUIEx.Protocol.Drawer;

namespace HK.Editor.GUIEx.Protocol.Window
{

    /// <summary>
    /// 保存白名单
    /// </summary>
    /// <param name="iWhiteList">白名单</param>
    /// <returns>true:OK; false:NG;</returns>
    public delegate bool SaveWhiteList(IWhiteList iWhiteList);
        
    /// <summary>
    /// 接口 : 白名单窗体
    /// </summary>
    /// <typeparam name="TWindData">白名单窗体数据类型</typeparam>
    public interface IWhiteListWindow<out TWindData> : IWindow<WindowConf, TWindData>
        where TWindData : JsonData, IWindowData
    {

        /// <summary>
        /// 总大小
        /// </summary>
        int TotalSize { get; }
        
        /// <summary>
        /// 检索中
        /// </summary>
        bool Searching { get; }
        
        /// <summary>
        /// 可见数量
        /// </summary>
        int VisibleSize { get; }
        
        /// <summary>
        /// 重置数据
        /// </summary>
        /// <param name="iList">白名单</param>
        /// <param name="iSaveCallback">保存回调</param>
        void ResetDataByWhiteList<TWhiteList>(TWhiteList iList, SaveWhiteList iSaveCallback)
            where TWhiteList : WhiteList, IOBrowse;
        
        /// <summary>
        /// 保存白名单
        /// </summary>
        SaveWhiteList Save { get; }

#region Drawer

        /// <summary>
        /// 分页绘制器
        /// </summary>
        IPaginationDrawer Pagination { get; }

#endregion

    }
}
